<!DOCTYPE html>
<html ng-app="myApp">

<head>
	<meta charset="utf-8">
</head>
<script src="angular-1.5.8/angular.min.js"></script>
<body ng-app="myApp">
  <div  ng-controller="testCtrl as ctrlParent">
    <roll-number nums="ctrlParent.nums1"></roll-number>
    <roll-number nums="ctrlParent.nums2"></roll-number>
  </div>
	<script>
		var app = angular.module("myApp", []);
    app.controller('testCtrl',function($scope){ 
      this.nums1 = ['4', '3', '2'] // 使用this.nums 赋值 传递给 子组件
      this.nums2 = ['6', '5', '4'] // 使用this.nums 赋值 传递给 子组件
    })

		app.component('rollNumber', {
				restrict: 'AE',
				replace: 'true',
				templateUrl: './templates/rollNumberComponent.html',
        controller: function ($scope) {
          $scope.rollList = ['', '', 'roll_1', 'roll_2', 'roll_3', 'roll_4', 'roll_5', 'roll_6', 'roll_7', 'roll_8', 'roll_9']
        },
        bindings: {
          nums: '='
        }
		});
	</script>

</body>
</html>